<template>
  <div>
     <van-nav-bar
      title="房屋管理"
      left-arrow
      @click-left="$router.push('/my')"
    />
    <div class="main">
      <div v-if="list.length" >
        <HouseItem v-for="item in list " :key="item.houseCode" :item="item"  ></HouseItem>
      </div>
          
      <div v-else>
        <img src="http://liufusong.top:8080/img/not-found.png" alt="">
      <p>您还没有发布房源,<span @click="$router.push('/rentHouse')" >去发布房源</span>吧~</p>
      </div>
    </div>
  </div>
</template>

<script>
import HouseItem from '@/components/house-item.vue'
import {lookRentHouse} from '@/api/house/'
export default {
  name: 'ManageHouse',
  
  async created (){
    const res= await lookRentHouse()
    console.log(res);
    this.list =res.body
  },
  components: {
    HouseItem
  },
  data() {
    return {
      list:[]
    }
  },

}
</script>

<style scoped lang="less">
   .main{
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    img{
      width: 150px;
      margin-bottom:10px ;
    }
    p{
      font-size: 14px;

      span{
        color: #33be85;
      }
    }
   }
 </style>
